#include<iostream>
#include"stringbad.h"
using std::cout;

void callme1(StringBad &);//引用调用
void callme2(StringBad);//值调用

int main()
{
    using std::endl;
    cout<<"starting an inner block.\n";
    StringBad headline1("yelan wife");
    StringBad headline2("letter from kokomi");
    StringBad sports("须弥要更新了");
    cout<<"headline1:"<<headline1<<endl;
    cout<<"headline2:"<<headline2<<endl;
    cout<<"sports:"<<sports<<endl;
    callme1(headline1);
    cout<<"headline1:"<<headline1<<endl;
    callme2(headline2);
    cout<<"headline2:"<<headline2<<endl;
    cout<<"把一个对象赋值给另一对象"<<endl;
    StringBad sailor=sports;
    cout<<"sailor:"<<sailor<<endl;
    cout<<"一个对象分配给另一对象"<<endl;
    StringBad knot;
    knot=headline1;
    cout<<"knot:"<<knot<<endl;
    cout<<"跳出主函数"<<endl;
}
void callme1(StringBad &rsb)
{
    cout<<"String passed by reference:\n";
    cout<<"\""<<rsb<<"\"\n";
}
void callme2(StringBad sb)
{
    cout<<"String passed by value:\n";
    cout<<"\""<<sb<<"\"\n";
}